package org.rency.common.trigger.schedule;

import java.util.HashMap;
import java.util.Map;

import org.quartz.JobDetail;
import org.rency.common.trigger.util.TriggerDict;
import org.springframework.scheduling.quartz.CronTriggerFactoryBean;

public class DaemonCronTriggerFactoryBean  extends CronTriggerFactoryBean{
	
	public DaemonCronTriggerFactoryBean(JobDetail jobDetail,DaemonTriggerBean bean){
		super.setCronExpression(bean.getCronExpression());
		super.setJobDetail(jobDetail);
		super.setName(TriggerDict.DAEMON_TRIGGER_NAME+bean.getBeanName());
		super.setDescription(bean.getDescription());
		super.setGroup(TriggerDict.DAEMON_GROUP_NAME);
		Map<String, Integer> map = new HashMap<String, Integer>();
		map.put(TriggerDict.JOB_TRIGGER_ID, bean.getTriggerId());
		super.setJobDataAsMap(map);
		super.afterPropertiesSet();
	}

}
